package com.ruoyi.web.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 分页查询工具
 * @param <T>
 * @author zhangwenqiang
 */
@Data
@ApiModel("分页查询")
public class PageQuery<T> implements Serializable {

    @ApiModelProperty(value = "当前页数",required = true)
    @NotNull(message = "当前页码不能为空")
    @Min(value = 1, message = "当前页码参数有误")
    private Integer page;

    @ApiModelProperty(value = "每页记录数",required = true)
    @NotNull(message = "每页展示条数不能为空")
    @Min(value = 1, message = "每页展示条数参数有误")
    private Integer pageSize;

    @ApiModelProperty("参数")
    @Valid
    private T data;
}
